package com.codingfuture.erp_system.service.impl;

import com.codingfuture.erp_system.entity.Emp;
import com.codingfuture.erp_system.mapper.LoginMapper;
import com.codingfuture.erp_system.service.LoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
public class LoginServiceImpl implements LoginService {

    @Autowired
    private LoginMapper loginMapper;

    @Override
    public Emp login(String username, String pwd) {
        return loginMapper.login(username, pwd);
    }

    @Transactional(rollbackFor = Exception.class)
    @Override
    public int updatePwd(String oldPwd, String newPwd, Object uuid) {
        return loginMapper.updatePwd(oldPwd, newPwd, uuid);
    }
}
